Skip to content

修复PNG格式空白图像出现超出索引范围的问题#4945

Open
yang-521 wants to merge 3 commits intoPaddlePaddle:developfrom
yang-521:patch-1
Open

修复PNG格式空白图像出现超出索引范围的问题#4945
yang-521 wants to merge 3 commits intoPaddlePaddle:developfrom
yang-521:patch-1

Conversation

@yang-521
Copy link

PNG格式空白图像进行文本检测后打印会出现超出索引范围的错误,目前测试中jpg不会出现这样的错误,只有png出现。
最小复现代码
from paddlex import create_model
from PIL import Image
import numpy as np
model = create_model(model_name="PP-OCRv3_mobile_det", model_dir='model/PP-OCRv3_mobile_det_infer') img = Image.open("0002.png")
image_array = np.array(img)
output = model.predict(image_array, batch_size=1)
for res in output:
print(res)

PNG格式空白图像进行文本检测后打印会出现超出索引范围的错误,目前测试中jpg不会出现这样的错误,只有png出现。 最小复现代码 from paddlex import create_model from PIL import Image import numpy as np model = create_model(model_name="PP-OCRv3_mobile_det", model_dir='model/PP-OCRv3_mobile_det_infer') img = Image.open("0002.png") image_array = np.array(img) 输出 = model.predict(image_array, batch_size=1) 对于输出中的 res: print(res)
@CLAassistant
Copy link

CLAassistant commented Jan 28, 2026

CLA assistant check
All committers have signed the CLA.

@paddle-bot
Copy link

paddle-bot bot commented Jan 28, 2026

Thanks for your contribution!

@paddle-bot paddle-bot bot added the contributor External developers label Jan 28, 2026
@luotao1
Copy link
Collaborator

luotao1 commented Feb 3, 2026

Please sign the CLA

@yang-521
Copy link
Author

yang-521 commented Feb 3, 2026

已签署

请签署CLA

leo-q8
leo-q8 previously approved these changes Feb 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants